package com.chen.mapper;

import com.chen.pojo.Person;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;
@Mapper
@Repository
public interface PersonMapper {

    @Insert("insert into person(id,name,pwd,sex,birthday,email) value(#{id},#{name},#{pwd},#{sex},#{birthday},#{email})")
    public void insert(Person person);
    @Select("select *from person where id=#{id}")
    public Person getById(int id);
    @Select("select *from person person")
    public  List<Person> list();
    @Update("update person set name=#{name},pwd=#{pwd}," +
            "sex=#{sex},birthday=#{birthday},email=#{email} where id=#{id}")
    public void update(Person person);
    @Delete("delete from person where id=#{id}")
    public void delete(int id);

}
